﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using Data;
using System.Data;

namespace SharedIFaces
{    
    [ServiceContract(SessionMode = SessionMode.Required, CallbackContract=typeof(IClient))]
    public interface IServer
    {
        [OperationContract]
        void Bind(User user);

        [OperationContract]
        User CreateUser(String login, String password);

        [OperationContract]
        Song CreateSong(Guid id);

        [OperationContract]
        void SaveSongFromUser(Song song, User user);

        [OperationContract]
        Playlist CreatePlaylist(Guid id);

        [OperationContract]
        List<Playlist> CreatePlaylists(String user);

        [OperationContract]
        List<PlaylistConnector> CreateConnectors(Guid id_playlist);

        [OperationContract]
        void DeletePlaylistConnector(PlaylistConnector connector);

        [OperationContract]
        void SavePlaylistConnector(PlaylistConnector connector);

        [OperationContract]
        String GetTable(String table_name);

        [OperationContract]
        void UpdateTable(String table_name, String content);

        [OperationContract]
        void InsertToTable(String table_name, String content);

        [OperationContract]
        void DeleteFromTable(String table_name, String content);

        [OperationContract(IsOneWay=true, IsTerminating=true)]
        void Disconnect(User user);
    }
}
